package com.ssy.lingxi.product.entity;

import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 商品草稿实体类
 * @author jw.chen
 * @version 2.0.0
 * @date 2022/03/28
 */
@Getter
@Setter
@Entity
@Table(schema = "public", name = "product_commodity_draft",
        indexes = {@Index(name = "product_commodity_draft_member_id_member_role_id_idx", columnList = "memberId,memberRoleId")})
public class CommodityDraft implements Serializable {
    private static final long serialVersionUID = 6537483058106520611L;

    /**
     * 主键id
     */
    @Id
    @GeneratedValue(strategy= GenerationType.SEQUENCE, generator="commodity_draft_seq")
    @SequenceGenerator(sequenceName="product_commodity_draft_seq", name="commodity_draft_seq",allocationSize = 1)
    private Long id;

    /**
     * 商品草稿
     */
    @Column(columnDefinition = "text", nullable = false)
    private String draft;

    /**
     * 会员id
     */
    @Column(columnDefinition = "int8", nullable = false)
    private Long memberId;

    /**
     * 会员名称
     */
    @Column(columnDefinition = "varchar(50)", nullable = false)
    private String memberName;

    /**
     * 会员角色id
     */
    @Column(columnDefinition = "int8", nullable = false)
    private Long memberRoleId;

    /**
     * 会员角色名称
     */
    @Column(columnDefinition = "varchar(50)", nullable = false)
    private String memberRoleName;

    /**
     * 用户id
     */
    @Column(columnDefinition = "int8", nullable = false)
    private Long userId;

    /**
     * 用户名称
     */
    @Column(columnDefinition = "varchar(50)", nullable = false)
    private String userName;

    /**
     * 创建时间
     */
    @Column(columnDefinition = "int8", nullable = false)
    private Long createTime = System.currentTimeMillis();

}
